import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/admin/login"
  },
  {
    path: "/admin/login",
    name: "admin_login",
    component: () => import("../views/admin/login/index.vue")

  },
  {
    path: "/admin/per/a",
    name: "",
    component: () => import("../views/admin/per/a"),
  },
  {
    path: "/admin/home",
    name: "首页",
    component: () => import("../views/admin/home"),
    children:[
      {
        path: "/admin/index",
        name: "admin_index",
        component: () => import("../views/admin/index"),
      },
      {
        path: "/admin/rights",
        name: "",
        component: () => import("../views/admin/per/rights"),
      },
     
      {
        path: "/admin/users",
        name: "",
        component: () => import("../views/admin/users/users"),
         meta:{
          bread:['用户管理','用户列表']
        }
      },
      {
        path: "/admin/roles",
        name: "",
        component: () => import("../views/admin/per/roles"),
      },
      {
      path: "/admin/goods",
      name: "",
      component: () => import("../views/admin/goods/index"),
      meta:{
        bread:['商品管理','商品列表']
      }
    },
    
    {
      path: "/admin/reports",
      name: "admin_reports",
      component: () => import("../views/admin/data/report"),
      meta:{
        bread:['数据统计','数据统计']
      }
    },
    // {
    //   path: "/admin/goods/create",
    //   name: "admin_goods_create",
    //   component: () => import("../views/admin/goods/create"),
    //   meta:{
    //     bread:['商品管理','商品添加']
    //   }
    // },
    
    ]
  }
]



const router = new VueRouter({
  routes
})




export default router
